<?php

namespace Home\Model;

class ConfigSystemModel extends CommonModel
{
    public function index($category='', $title='')
    {
        if ($category && $title) {
            $data = (new ConfigSystemModel)->where(['category' => $category, 'title' => $title])->getField('title, content');
        } else if ($category) {
            $data = (new ConfigSystemModel)->where(['category' => $category])->getField('title, content');
        } else if ($title) {
            $data = (new ConfigSystemModel)->where(['title' => $title])->getField('title, content');
        } else {
            $data = (new ConfigSystemModel)->getField('title, content');
        }

        return $data;
    }
}
